#ifndef MYWINDOW_H
#define MYWINDOW_H

#include "../ui_multimedia_toolbox.h"
#include <QMenuBar>
#include <QAction>
#include <QTabWidget>
#include <QMenu>
#include <QIcon>
#include <QSound>
#include <QTranslator>
#include <QMessageBox>
#include <QDir>
#include <QFileDialog>
#include <QFile>
#include <QStringList>
#include <iostream>

//#include "../Core/SoundObj.hpp"
#include "../Core/ImageObj.h"

#include "TabBar.h"
#include "MyNewSoundWin.h"
#include "EqualizeWindow.h"
#include "Settings.h"
#include "About.h"
#include "FFTPlot.h"

class Settings;

class MyWindow : public QMainWindow
{
	Q_OBJECT
	public:
		MyWindow(QMainWindow *parent = 0);
		void applySettings(QStringList *);
		~MyWindow();
		//Sound
		QSound *sound;
		SoundObj *soundO;

	public slots:
		//SettingsActions
		void frenchLanguage();
		void englishLanguage();

	private slots:
		void openSettings();
		// FileActions
		void openFile();
		void newSound();
		bool saveFile();
		// EditActions
		void openEqualizer();
		void disableMenus(int);
		void concatenate();
		void combine();
		void imageDCT();
		void soundFFT();
		// HelpActions
		void about();

	private:

	    const static long winWidth  = 600L;
		const static long winHeight = 700L;

		Ui::Multimedia_ToolboxClass ui;
		// FileMenu
		QMenu *menuFile;
		QAction *actionOpenFile;
		QAction *actionNewFile;
		QAction *actionSaveFile;
		QAction *actionExit;

		// EditMenu
		QMenu *menuEdit;
		QMenu *menuEditImage;
		QAction *actionEditImageCrop;
		QMenu *menuEditSound;
		QAction *actionEditSoundConcatenate;
		QAction *actionEditSoundCombine;
		QAction *actionEditSoundEqualize;

		//ViewMenu
		QMenu *menuView;
		QMenu *menuViewImage;
		QAction *actionViewImageDCT;
		QMenu *menuViewSound;
		QAction *actionViewSoundFFT;

		//SettingsMenu
		QMenu *menuSettings;
		QAction *settings;

		//HelpMenu
		QMenu *menuHelp;
		QAction *actionHelp;
		QAction *actionAbout;

		//Tabs
		TabBar *tabs;
		QApplication *a;
		QTranslator toolboxTranslator;

		MyNewSoundWin *newSoundWin;
		EqualizeWindow *equalizerWin;
		Settings *settingsWin;
		About* aboutWin;

		QStringList * settingsList;

	protected:
		ImageObj* imageO;
		void contextMenuEvent(QContextMenuEvent *event);

		void buildActions();
		void windowSize();
		void buildMenus();
		void uploadSettings();

		void buildFileMenu();
		void buildEditMenu();
		void buildViewMenu();
		void buildSettingsMenu();
		void buildHelpMenu();

		void actionsOnFile();
		void actionsOnEdit();
		void actionsOnView();
		void actionsOnSettings();
		void actionsOnHelp();

		//ViewActions
		void imageView();
		void soundView();
};

#endif // MYWINDOW_H
